#!/usr/bin/python
# vim:fileencoding=utf8
"""
Описывает класс действия.
"""

import concept

class Action(concept.Concept):

    def __init__(self, word, person=0, plurum=False):
        """
        Инициализация объекта.
            name --- название объекта (англиское)
            person --- лицо 1s, 2s, 2p, 3s, 3p
        """
        concept.Concept.__init__(self, word)
        self.__person = person
        self.plurum = plurum
        self.negative = False
        self.direct_object = None
    
    def set_negative(self, neg=True):
        self.negative = neg
        return self
    
    def get_negative(self):
        return self.negative
    
    def set_form(self, **form):
        self.__person = form.get('person', self.__person)
        self.__pl = form.get('plurum', self.__pl)
        return self
    
        
    def set_direct_object(self, dir_obj):
        self.direct_object = dir_obj
        return self
    

    def to_string(self, **form):
        word_str = self.word.to_string(**form)
        if self.direct_object is not None:
            direct_obj_str = self.direct_object.to_string()
        else:
            direct_obj_str = ''
        res = ' '.join([word_str, direct_obj_str])
        return res.strip()  